static-lib=libmyMath.a
dy-lib=libmymethod.so

.PHONY:all
all:$(static-lib) $(dy-lib)

$(static-lib):myMath.o
	ar -rc $@ $^
myMath.o:myMath.c
	gcc -c $^

$(dy-lib):myPrint.o myLog.o
	gcc -shared -o $@ $^

myPrint.o:myPrint.c
	gcc -c -fPIC $^
myLog.o:myLog.c
	gcc -c -fPIC $^

.PHONY:clean
clean:
	rm -rf *.o *.a *.so lib

.PHONY:output
output:
	mkdir -p lib/include
	mkdir -p lib/mylib
	cp *.h lib/include
	cp *.a lib/mylib
	cp *.so lib/mylib
